From: Caolán McNamara Date: Wed, 1 Apr 2026 20:19:19 +0000 (+0000) Subject: [PATCH] Show infobar for calc graphics with remote content too X-Git-Tag: archive/raspbian/4%25.2.3-2+rpi1+deb13u8^2~12 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=79fbcc6421984b2e22fddf0425e3128b82c0489e;p=libreoffice.git [PATCH] Show infobar for calc graphics with remote content too Change-Id: I8ed0482344bb06afa6079540ea2a3854930da225 Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2383 Tested-by: Jenkins CPCI Reviewed-by: Miklos Vajna (cherry picked from commit 1f51bbee0e7661d5607efe2603c59d83f410dd3d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205492 Tested-by: Jenkins Reviewed-by: Xisco Fauli Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208405 Tested-by: Christian Lohmaier Reviewed-by: Christian Lohmaier Gbp-Pq: Name Show-infobar-for-calc-graphics-with-remote-content-too.diff --- diff --git a/sc/inc/documentlinkmgr.hxx b/sc/inc/documentlinkmgr.hxx index de36ec40fa8..36369a5d04b 100644 --- a/sc/inc/documentlinkmgr.hxx +++ b/sc/inc/documentlinkmgr.hxx @@ -53,7 +53,7 @@ public: bool idleCheckLinks(); bool hasDdeLinks() const; - bool hasDdeOrOleOrWebServiceLinks() const; + bool hasExternalLinks() const; bool hasExternalRefLinks() const; bool updateDdeOrOleOrWebServiceLinks(weld::Window* pWin); @@ -63,7 +63,7 @@ public: size_t getDdeLinkCount() const; private: - bool hasDdeOrOleOrWebServiceLinks(bool bDde, bool bOle, bool bWebService) const; + bool hasExternalLinks(bool bDde, bool bOle, bool bWebService, bool bGraphic) const; }; } diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index a00bf023c74..f9744533772 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -203,6 +204,12 @@ void ScDocShell::ReloadAllLinks() } m_pDocument->UpdateAreaLinks(); + + // update linked graphics from the draw layer + if (sfx2::LinkManager* pLinkMgr = m_pDocument->GetDocLinkManager().getLinkManager(false)) + { + pLinkMgr->UpdateAllLinks(false, false, nullptr, u""_ustr); + } } IMPL_LINK( ScDocShell, ReloadAllLinksHdl, weld::Button&, rButton, void ) diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx index 0fb89cfa0d1..d098631bc21 100644 --- a/sc/source/ui/docshell/documentlinkmgr.cxx +++ b/sc/source/ui/docshell/documentlinkmgr.cxx @@ -125,15 +125,15 @@ bool DocumentLinkManager::idleCheckLinks() bool DocumentLinkManager::hasDdeLinks() const { - return hasDdeOrOleOrWebServiceLinks(true, false, false); + return hasExternalLinks(true, false, false, false); } -bool DocumentLinkManager::hasDdeOrOleOrWebServiceLinks() const +bool DocumentLinkManager::hasExternalLinks() const { - return hasDdeOrOleOrWebServiceLinks(true, true, true); + return hasExternalLinks(true, true, true, true); } -bool DocumentLinkManager::hasDdeOrOleOrWebServiceLinks(bool bDde, bool bOle, bool bWebService) const +bool DocumentLinkManager::hasExternalLinks(bool bDde, bool bOle, bool bWebService, bool bGraphic) const { sfx2::LinkManager* pMgr = mpImpl->mpLinkManager; if (!pMgr) @@ -149,6 +149,8 @@ bool DocumentLinkManager::hasDdeOrOleOrWebServiceLinks(bool bDde, bool bOle, boo return true; if (bWebService && dynamic_cast(pBase)) return true; + if (bGraphic && pBase->GetObjType() == sfx2::SvBaseLinkObjectType::ClientGraphic) + return true; } return false; diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index af8496c347b..0e5abc8390e 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1632,7 +1632,7 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) if (!bLink) { const sc::DocumentLinkManager& rMgr = rDoc.GetDocLinkManager(); - if (rDoc.HasLinkFormulaNeedingCheck() || rDoc.HasAreaLinks() || rMgr.hasDdeOrOleOrWebServiceLinks()) + if (rDoc.HasLinkFormulaNeedingCheck() || rDoc.HasAreaLinks() || rMgr.hasExternalLinks()) bLink = true; } if (bLink)